<?php
class Namemanager_Model_Insertnamedata implements Namemanager_Data_Mainable{
    
    private $core_controller_notnull;
    private $core_controller_tokencheckout;
    
    private $excepted_result = 1;
    private $actual_result;
    
    private $namemanager_data_insertnamedata;
    
    public function main(array $variables = null) {
        $this->core_controller_notnull = new Core_Controller_Notnull;
        $this->core_controller_tokencheckout = new Core_Controller_Tokencheckout;
        
        $this->core_controller_notnull->main($variables);
        $this->core_controller_tokencheckout->main($variables['post']);
        
        $this->namemanager_data_insertnamedata = new Namemanager_Data_Insertnamedata;
        $this->actual_result = $this->namemanager_data_insertnamedata->main($variables);
        
        if(
                $this->actual_result == $this->excepted_result
                ){
            header("Location: ".SITE_ROOT."ustawienia-wlasne.html");
        }
        else {
            header("Location: ".SITE_ROOT."ustawienia-wlasne.html");
        }
    }
}
